/**
 * futures : masterlink.futures.vo.Fuhivc.java
 */
package masterlink.futures.vo;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * TODO Write the description
 *
 * @author : tonyyang
 * Create date : 2011/10/27
 * @version 1.0.0	
 */
@Entity
@Table(name="GREEKS_VERB")
public class GreekVerb implements Serializable {

	/**
	 * TODO write the document
	 */
	private static final long serialVersionUID = -5613567214678821166L;
	@EmbeddedId
	private GreekVerbPK id;
	@Column(name="SELL_MRKTPRICE")
	private Double sellMrktPrice=0d;
	@Column(name="BUY_MRKTPRICE")
	private Double buyMrktPrice=0d;
	@Column(name="TIMEVALUE")
	private Double timeValue=0d;
	@Column(name="DELTA")
	private Double delta=0d;
	@Column(name="GAMMA")
	private Double gamma=0d;
	@Column(name="THETA")
	private Double theta=0d;
	@Column(name="VEGA")
	private Double vega=0d;
	@Column(name="AVOID_FUT")
	private Double avoidFut=0d;
	@Column(name="OPT_MRKT")
	private Double optMrkt=0d;
	@Column(name="OPT_BALANCE")
	private Double optBalance=0d;
	@Column(name="FUT_BALANCE")
	private Double futBalance=0d;
	@Column(name="MRKT_SUM")
	private Double mrktSum=0d;
	@Column(name="BALANCE_SUM")
	private Double balanceSum=0d;
	@Column(name="REF_SUM")
	private Double refSum=0d;
	@Column(name="REACHRATE")
	private Double reachRate=0d;
	@Column(name="DELTA_MRKT")
	private Double deltaMrkt=0d;
	@Column(name="FUTPRICE")
	private Double futPrice=0d;

	/**
	 * @return the id
	 */
	public GreekVerbPK getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(GreekVerbPK id) {
		this.id = id;
	}

	/**
	 * @return the sellMrktPrice
	 */
	public Double getSellMrktPrice() {
		return sellMrktPrice;
	}

	/**
	 * @param sellMrktPrice the sellMrktPrice to set
	 */
	public void setSellMrktPrice(Double sellMrktPrice) {
		this.sellMrktPrice = sellMrktPrice;
	}

	/**
	 * @return the buyMrktPrice
	 */
	public Double getBuyMrktPrice() {
		return buyMrktPrice;
	}

	/**
	 * @param buyMrktPrice the buyMrktPrice to set
	 */
	public void setBuyMrktPrice(Double buyMrktPrice) {
		this.buyMrktPrice = buyMrktPrice;
	}

	/**
	 * @return the timeValue
	 */
	public Double getTimeValue() {
		return timeValue;
	}

	/**
	 * @param timeValue the timeValue to set
	 */
	public void setTimeValue(Double timeValue) {
		this.timeValue = timeValue;
	}

	/**
	 * @return the delta
	 */
	public Double getDelta() {
		return delta;
	}

	/**
	 * @param delta the delta to set
	 */
	public void setDelta(Double delta) {
		this.delta = delta;
	}

	/**
	 * @return the gamma
	 */
	public Double getGamma() {
		return gamma;
	}

	/**
	 * @param gamma the gamma to set
	 */
	public void setGamma(Double gamma) {
		this.gamma = gamma;
	}

	/**
	 * @return the theta
	 */
	public Double getTheta() {
		return theta;
	}

	/**
	 * @param theta the theta to set
	 */
	public void setTheta(Double theta) {
		this.theta = theta;
	}

	/**
	 * @return the vega
	 */
	public Double getVega() {
		return vega;
	}

	/**
	 * @param vega the vega to set
	 */
	public void setVega(Double vega) {
		this.vega = vega;
	}

	/**
	 * @return the avoidFut
	 */
	public Double getAvoidFut() {
		return avoidFut;
	}

	/**
	 * @param avoidFut the avoidFut to set
	 */
	public void setAvoidFut(Double avoidFut) {
		this.avoidFut = avoidFut;
	}

	/**
	 * @return the optMrkt
	 */
	public Double getOptMrkt() {
		return optMrkt;
	}

	/**
	 * @param optMrkt the optMrkt to set
	 */
	public void setOptMrkt(Double optMrkt) {
		this.optMrkt = optMrkt;
	}

	/**
	 * @return the optBalance
	 */
	public Double getOptBalance() {
		return optBalance;
	}

	/**
	 * @param optBalance the optBalance to set
	 */
	public void setOptBalance(Double optBalance) {
		this.optBalance = optBalance;
	}

	/**
	 * @return the futBalance
	 */
	public Double getFutBalance() {
		return futBalance;
	}

	/**
	 * @param futBalance the futBalance to set
	 */
	public void setFutBalance(Double futBalance) {
		this.futBalance = futBalance;
	}

	/**
	 * @return the mrktSum
	 */
	public Double getMrktSum() {
		return mrktSum;
	}

	/**
	 * @param mrktSum the mrktSum to set
	 */
	public void setMrktSum(Double mrktSum) {
		this.mrktSum = mrktSum;
	}

	/**
	 * @return the balanceSum
	 */
	public Double getBalanceSum() {
		return balanceSum;
	}

	/**
	 * @param balanceSum the balanceSum to set
	 */
	public void setBalanceSum(Double balanceSum) {
		this.balanceSum = balanceSum;
	}

	/**
	 * @return the refSum
	 */
	public Double getRefSum() {
		return refSum;
	}

	/**
	 * @param refSum the refSum to set
	 */
	public void setRefSum(Double refSum) {
		this.refSum = refSum;
	}

	/**
	 * @return the reachRate
	 */
	public Double getReachRate() {
		return reachRate;
	}

	/**
	 * @param reachRate the reachRate to set
	 */
	public void setReachRate(Double reachRate) {
		this.reachRate = reachRate;
	}

	/**
	 * @return the deltaMrkt
	 */
	public Double getDeltaMrkt() {
		return deltaMrkt;
	}

	/**
	 * @param deltaMrkt the deltaMrkt to set
	 */
	public void setDeltaMrkt(Double deltaMrkt) {
		this.deltaMrkt = deltaMrkt;
	}

	/**
	 * @return the futPrice
	 */
	public Double getFutPrice() {
		return futPrice;
	}

	/**
	 * @param futPrice the futPrice to set
	 */
	public void setFutPrice(Double futPrice) {
		this.futPrice = futPrice;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("GreekVerb [id=");
		builder.append(id);
		builder.append(", sellMrktPrice=");
		builder.append(sellMrktPrice);
		builder.append(", buyMrktPrice=");
		builder.append(buyMrktPrice);
		builder.append(", timeValue=");
		builder.append(timeValue);
		builder.append(", delta=");
		builder.append(delta);
		builder.append(", gamma=");
		builder.append(gamma);
		builder.append(", theta=");
		builder.append(theta);
		builder.append(", vega=");
		builder.append(vega);
		builder.append(", avoidFut=");
		builder.append(avoidFut);
		builder.append(", optMrkt=");
		builder.append(optMrkt);
		builder.append(", optBalance=");
		builder.append(optBalance);
		builder.append(", futBalance=");
		builder.append(futBalance);
		builder.append(", mrktSum=");
		builder.append(mrktSum);
		builder.append(", balanceSum=");
		builder.append(balanceSum);
		builder.append(", refSum=");
		builder.append(refSum);
		builder.append(", reachRate=");
		builder.append(reachRate);
		builder.append(", deltaMrkt=");
		builder.append(deltaMrkt);
		builder.append(", futPrice=");
		builder.append(futPrice);
		builder.append("]");
		return builder.toString();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof GreekVerb))
			return false;
		GreekVerb other = (GreekVerb) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	public static class GreekVerbPK implements Serializable{

		private static final long serialVersionUID = 7175884786694696118L;
		@Column(name="account")
		private String account;
		@Column(name="BROKER")
		private String broker;
		@Column(name="RATE")
		private Double rate=0d;
		@Column(name="SETMONTH")
		private String setMonth;
		@Column(name="UPDATE_TIME")
		private Timestamp updateTime;
		
		/**
		 * @return the account
		 */
		public String getAccount() {
			return account;
		}
		/**
		 * @param account the account to set
		 */
		public void setAccount(String account) {
			this.account = account;
		}
		/**
		 * @return the broker
		 */
		public String getBroker() {
			return broker;
		}
		/**
		 * @param broker the broker to set
		 */
		public void setBroker(String broker) {
			this.broker = broker;
		}
		/**
		 * @return the rate
		 */
		public Double getRate() {
			return rate;
		}
		/**
		 * @param rate the rate to set
		 */
		public void setRate(Double rate) {
			this.rate = rate;
		}
		/**
		 * @return the setMonth
		 */
		public String getSetMonth() {
			return setMonth;
		}
		/**
		 * @param setMonth the setMonth to set
		 */
		public void setSetMonth(String setMonth) {
			this.setMonth = setMonth;
		}
		/**
		 * @return the updateTime
		 */
		public Timestamp getUpdateTime() {
			return updateTime;
		}

		/**
		 * @param updateTime the updateTime to set
		 */
		public void setUpdateTime(Timestamp updateTime) {
			this.updateTime = updateTime;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#hashCode()
		 */
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result
					+ ((account == null) ? 0 : account.hashCode());
			result = prime * result
					+ ((broker == null) ? 0 : broker.hashCode());
			result = prime * result + ((rate == null) ? 0 : rate.hashCode());
			result = prime * result
					+ ((setMonth == null) ? 0 : setMonth.hashCode());
			return result;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#equals(java.lang.Object)
		 */
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (!(obj instanceof GreekVerbPK))
				return false;
			GreekVerbPK other = (GreekVerbPK) obj;
			if (account == null) {
				if (other.account != null)
					return false;
			} else if (!account.equals(other.account))
				return false;
			if (broker == null) {
				if (other.broker != null)
					return false;
			} else if (!broker.equals(other.broker))
				return false;
			if (rate == null) {
				if (other.rate != null)
					return false;
			} else if (!rate.equals(other.rate))
				return false;
			if (setMonth == null) {
				if (other.setMonth != null)
					return false;
			} else if (!setMonth.equals(other.setMonth))
				return false;
			return true;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#toString()
		 */
		@Override
		public String toString() {
			StringBuilder builder = new StringBuilder();
			builder.append("GreekVerbPK [account=");
			builder.append(account);
			builder.append(", broker=");
			builder.append(broker);
			builder.append(", rate=");
			builder.append(rate);
			builder.append(", setMonth=");
			builder.append(setMonth);
			builder.append("]");
			return builder.toString();
		}
	}
}
